package leetcode_周赛._2021._202103._20210314;

/**
 * @author yzh
 * @data 2021/3/20 14:59
 * 找出星型图的中心节点
 */
public class _1791 {

    public int findCenter(int[][] edges) {
        int ans = -1;
        if (edges[0][0] == edges[1][0] || edges[0][0] == edges[1][1]) ans = edges[0][0];
        if (edges[0][1] == edges[1][0] || edges[0][1] == edges[1][1]) ans = edges[0][1];
        return ans;
    }
}
